package chapter1.date.task;
/*
3：输出今年的国庆节（10.1）是周几
 */

import java.util.*;

public class Task3 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        Calendar calendar = Calendar.getInstance();
        System.out.print("请输入年份：");
        String year;
        while (!(year = input.next()).matches("\\d{4}"))
            System.out.println("输入错误，请重新输入：");
        calendar.set(Integer.parseInt(year), 9, 1);
        System.out.println("今年的国庆节（10.1）是周" + calendar.get(Calendar.DAY_OF_WEEK)); 
    }
}
